import Vue from 'vue';
import VueRouter from 'vue-router';
/* Layout */
// import Layout from '@/layout';

import Main from '../views/Main'

Vue.use(VueRouter);

// export const constantRoutes = [
//   {
//     path: '/',
//     component: Layout,
//     redirect: '/dashboard',
//     name: 'Dashboard',
//     children: [
//       {
//         path: 'dashboard',
//         name: 'dashboard',
//         component: () => import('@/views/dashboard/index'),
//         meta: { title: '工作台', icon: 'custom icongongzuotai', affix: true },
//       },
//     ],
//   },
//   {
//     path: '/test',
//     component: Layout,
//     name: 'Test',
//     children: [
//       {
//         path: '',
//         name: 'test',
//         component: () => import('@/views/test/index'),
//         meta: { title: 'test', icon: 'custom icongongzuotai', affix: true },
//       },
//     ],
//   }
// ];

export const constantRoutes = [
  {
    path: '/',
    component: Main,
    name: 'Main',
  },
  {
    path: '/test',
    name: 'Test',
    component: () => import('@/views/test/index')
  }
];

const createRouter = () =>
  new VueRouter({
    // mode: 'history', // require service support
    // scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes,
  });

const router = createRouter();

export default router;
